home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / dpmigcc5.zip / RSX / SOURCE / GNUAOUT.H < prev    next >
C/C++ Source or Header  |  1994-12-12  |  2KB  |  86 lines

  1. /* Copyright    Rainer Schnitker 92,93 */
  2.  
  3. #ifndef _DPMI_TYPES
  4. #define _DPMI_TYPES
  5. #include "DPMITYPE.H"
  6. #endif
  7.  
  8. #define N_MAGIC(exec) ((exec).a_info & 0xffff)
  9. #define OMAGIC 0x107
  10. #define NMAGIC 0x108
  11. #define ZMAGIC 0x10B
  12.  
  13. /* load different sizes */
  14. #define _N_HDROFF(x)    _n_hdroff
  15. #define N_TXTADDR(x)    n_txtaddr
  16. #define SEGMENT_SIZE    segment_size
  17.  
  18. #define N_DATADDR(x) (SEGMENT_SIZE + ((N_TXTADDR(x)+(x).a_text-1) & ~(SEGMENT_SIZE-1)))
  19. #define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
  20.  
  21. #define N_TXTOFF(x) (_N_HDROFF((x)) + sizeof (struct exec))
  22. #define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
  23. #define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
  24. #define N_DRELOFF(x) (N_TRELOFF(x) + (x).a_trsize)
  25. #define N_SYMOFF(x) (N_DRELOFF(x) + (x).a_drsize)
  26. #define N_STROFF(x) (N_SYMOFF(x) + (x).a_syms)
  27.  
  28. typedef struct exec {
  29.     DWORD a_info;     /* Use macros N_MAGIC, etc for access */
  30.     DWORD a_text;     /* length of text, in bytes */
  31.     DWORD a_data;     /* length of data, in bytes */
  32.     DWORD a_bss;      /* length of uninitialized data area for file, in bytes */
  33.     DWORD a_syms;     /* length of symbol table data in file, in bytes */
  34.     DWORD a_entry;    /* start address */
  35.     DWORD a_trsize;   /* length of relocation info for text, in bytes */
  36.     DWORD a_drsize;   /* length of relocation info for data, in bytes */
  37.     } GNUOUT ;
  38.  
  39. typedef struct {
  40.     WORD  magic;
  41.     WORD  vstamp;
  42.     DWORD tsize;    /* text size in bytes, padded to FW bdry*/
  43.     DWORD dsize;    /* initialized data "  "                */
  44.     DWORD bsize;    /* uninitialized data "   "             */
  45.     DWORD entry;    /* entry pt.                */
  46.     DWORD text_start;    /* base of text used for this file    */
  47.     DWORD data_start;    /* base of data used for this file    */
  48. } AOUTHDR;
  49.  
  50. typedef struct filehdr {
  51.     WORD    f_magic;
  52.     WORD    f_nscns;
  53.     DWORD    f_timdat;
  54.     DWORD    f_symptr;
  55.     DWORD    f_nsyms;
  56.     WORD    f_opthdr;
  57.     WORD    f_flags;
  58. } FILEHDR;
  59.  
  60. typedef struct scnhdr {
  61.     char    s_name[8];
  62.     DWORD    s_paddr;
  63.     DWORD    s_vaddr;
  64.     DWORD    s_size;
  65.     DWORD    s_scnptr;
  66.     DWORD    s_relptr;
  67.     DWORD    s_lnnoptr;
  68.     WORD    s_nreloc;
  69.     WORD    s_nlnno;
  70.     DWORD    s_flags;
  71. } SCNHDR;
  72.  
  73. struct exe_hdr {
  74.     WORD signatur;
  75.     WORD low;
  76.     WORD high;
  77.     WORD reloc;
  78.     WORD hdr_para;
  79.     } ;
  80.  
  81. struct emx_hdr2 {
  82.     char sig[18];
  83.     char next_hdr[4];
  84.     char option[64];
  85. };
  86.